﻿using MengLin.OOP.DesignPattern.StatePattern.WorkState.Abstract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.StatePattern.WorkState.Implements
{
    /// <summary>
    /// 上午工作状态
    /// </summary>
    public class ForenoonState : AbstractState
    {
        public override void WriteProgram(WorkContext w)
        {
            if (w.Hour < 12)
            {
                Console.WriteLine("当前时间：{0}点 上午工作，精神百倍", w.Hour);
            }
            else
            {
                w.SetState(new NoonState());
                w.WriteProgram();
            }
        }
    }
}
